package com.redijedi.tapestry5;

import java.util.Collection;
import java.util.Map;

/**
 * Defines a tree of related nodes.
 * 
 * @author torr
 * 
 */
public interface TreeModel {

	/**
	 * Additional attributes to render with the &lt;tree&gt;. This is often used
	 * to render the CSS class attribute. May return null.
	 */
	abstract Map<String, String> getAttributes();

	/**
	 * The list of nodes within the tree. These will be TreeModel instances
	 * themselves as this is used to represent a hierarchy of data. However, at
	 * any level there may be a number of objects spanning width, so it is best
	 * represented as a collection.
	 */
	abstract Collection<TreeNodeModel> getNodes();

}
